<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>管理后台</title>
    <link rel="stylesheet/less" href="../../../static/css/index.less"/>
    <link rel="stylesheet" href="../../../static/layui/css/layui.css"/>
    <link rel="stylesheet" href="../../../static/css/jquery.pagination.css"/>
    <script src="../../../static/js/jquery-1.12.3.js"></script>
    <script src="../../../static/js/less.min.js"></script>
    <script src="../../../static/layui/layui.js"></script>
    <script src="../../../static/js/ajaxfileupload.js"></script>
    <script src="../../../static/layer/layer.js"></script>
    <SCRIPT language=javascript src="../../static/layer/layer.js"></SCRIPT>
</head>
<style>
    #test1 {
        display: inline-block;
        width: 15%;
    }
</style>
<body class="layui-layout-body">

{% include "/admin/top.html" %}
{% include "/admin/left.html" %}

<div id="box" class="fl">
    <div class="content" style="height: 100%">
        <h3 style="color:  #3D89CB">用户套餐列表</h3>

        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <thead>
            <tr>
                 <th>套餐名</th>
                <th width="15%">套餐次数</th>
                <th width="10%">使用次数</th>
                <th width="10%">剩余次数</th>

                <th>购买时间</th>
                <th>过期时间</th>
                <th>来源</th>

                <th>是否过期</th>

            </tr>
            </thead>
            <tbody id="content">

            {% if res['res'] %}
                {% for data in res['res'] %}
                    <tr>
                        <td>{{ data.recharge_name }}</td>
                        <td>{{ data.recharge_num }}</td>
                        <td>{{ data.use_num }}</td>
                    <td>{{ data.odd }}</td>

                        <td>{{ data.add_time }}</td>
                        <td>{{ data.end_time }}</td>
                        <td>{% if data.source_type==0 %}
                        自己购买
                        {% elif data.source_type==1 %}
                        用户赠送
                        {% elif data.source_type==2 %}
                        商家赠送
                        {% endif %}</td>
                        <td>{{ data.period }}</td>
                    </tr>
                {% endfor %}
            {% else %}
                <tr></tr>
                <td colspan=8 align="center">暂无数据</td></tr>
            {% endif %}


            </tbody>
        </table>
        <div id="page" class="ui-pagination-container">
            {% if res.max_page > 0 %}
                <div class="ui-pagination-container">
                    {% if res.page > 1 %}
                        <a href="/admin/user/suit.html?page=1&uid={{ res.uid }}" class="ui-pagination-page-item"
                           data-current="1">首页</a>
                        <a href="/admin/user/suit.html?page={{ res.page - 1 }}&uid={{ res.uid }}"
                           class="ui-pagination-page-item"
                           data-current="1">上一页</a>
                    {% endif %}
                    {% if res.page - 2 > 0 %}
                        <a href="/admin/user/suit.html?page={{ res.page - 2 }}"
                           class="ui-pagination-page-item"
                           data-current="1">{{ res.page - 2 }}</a>
                    {% endif %}
                    {% if res.page - 1 > 0 %}
                        <a href="/admin/user/suit.html?page={{ res.page - 1 }}&uid={{ res.uid }}"
                           class="ui-pagination-page-item"
                           data-current="1">{{ res.page - 1 }}</a>
                    {% endif %}
                    <a href="javascript:void(0);" class="ui-pagination-page-item active"
                       data-current="2">{{ res.page }}</a>
                    {% if res.page + 1 <= res.max_page %}
                        <a href="/admin/user/suit.html?page={{ res.page + 1 }}&uid={{ res.uid }}"
                           class="ui-pagination-page-item"
                           data-current="3">{{ res.page + 1 }}</a>
                    {% endif %}
                    {% if res.page + 2 <= res.max_page %}
                        <a href="/admin/user/suit.html?page={{ res.page + 2 }}&uid={{ res.uid }}"
                           class="ui-pagination-page-item"
                           data-current="3">{{ res.page + 2 }}</a>
                    {% endif %}
                    {% if res.page + 1 <= res.max_page %}
                        <a href="/admin/user/suit.html?page= {{ res.page + 1 }}&uid={{ res.uid }}"
                           class="ui-pagination-page-item"
                           data-current="3">下一页</a>
                        <a href="/admin/user/suit.html?page= {{ res.max_page }}&uid={{ res.uid }}"
                           class="ui-pagination-page-item"
                           data-current="12">尾页</a>
                    {% endif %}
                </div>
            {% endif %}
        </div>
    </div>
</div>
</div>
<input type="hidden" value="1" id="p">
</body>
</html>
<script>
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#test1', //指定元素
        });
    });


</script>
